Repository navigation
Conversation
Current coverage is 84.57% (diff: 100%)
|
There was a problem hiding this comment.
Maybe add a test for the empty case as well?
In [23]: pd.RangeIndex().is_monotonic_increasing
Out[23]: True
In [24]: pd.RangeIndex().is_monotonic_decreasing
Out[24]: True
There was a problem hiding this comment.
Although this should maybe rather raise an error (@jreback)
Other index types to raise without arguments, and range() does as well.
There was a problem hiding this comment.
@jorisvandenbossche empty case is coverd by (1, 1).
pd.RangeIndex(1, 1).values
# array([], dtype=int64)
Let me issue a separate PR to prohibit empty construction.
There was a problem hiding this comment.
Ah yes, assumed that RangeIndex() does not has a step yet, but that is of course wrong :-)
There was a problem hiding this comment.
yeah I don't think RangeIndex() should be permitted, though I seem to remember needing it for unpickling or somesuch.......
There was a problem hiding this comment.
let's make a new issue about the empty RangeIndex()
git diff upstream/master | flake8 --diffas the same as
is_unique, it should be monotonic by definition